home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d18 / vis082s.arc / PCBOARD.PAS < prev    next >
Pascal/Delphi Source File  |  1991-04-17  |  9KB  |  241 lines

  1. {$R-,S-,I-,D-,F+,V-,B-,L+,O+ }
  2.  
  3. unit pcboard;
  4.  
  5. interface
  6.  
  7. uses crt,dos,
  8.      gentypes,
  9.      Subs1,configrt;
  10.  
  11. Procedure Definefiles;
  12.  
  13. implementation
  14.  
  15. Type Single_87 = System.Single;
  16.  
  17. Procedure Def_pcbFile;
  18. type
  19.  
  20.    anystring = string[128];
  21.    longstring = string[255];
  22.  
  23.    string2   = string[2];
  24.    string8   = string[8];
  25.    string12  = string[12];
  26.    string13  = string[13];
  27.    string20  = string[20];
  28.    string30  = string[30];
  29.    string65  = string[65];
  30.    string72  = string[72];
  31.    string160 = string[160];
  32.    string255 = string[255];
  33.  
  34.    char2  = array[1..2] of char;
  35.    char3  = array[1..3] of char;
  36.    char4  = array[1..4] of char;
  37.    char5  = array[1..5] of char;
  38.    char6  = array[1..6] of char;
  39.    char7  = array[1..7] of char;
  40.    char8  = array[1..8] of char;
  41.    char9  = array[1..9] of char;
  42.    char10 = array[1..10] of char;
  43.    char11 = array[1..11] of char;
  44.    char12 = array[1..12] of char;
  45.    char13 = array[1..13] of char;
  46.    char14 = array[1..14] of char;
  47.    char15 = array[1..15] of char;
  48.    char16 = array[1..16] of char;
  49.    char19 = array[1..19] of char;
  50.    char24 = array[1..24] of char;
  51.    char25 = array[1..25] of char;
  52.    char30 = array[1..30] of char;
  53.    char32 = array[1..32] of char;
  54.    char45 = array[1..45] of char;
  55.    char128 = array[1..128] of char;
  56.  
  57.    {layout of the PCBOARD.SYS file while doors are open}
  58.   PCB_sys_rec   = Record             { 128 Bytes for PCBOARD version 14.0  }
  59.          Display  : char2;            { Sysop's Display ON/OFF              }
  60.          Printer  : char2;            { Sysop's Printer ON/OFF              }
  61.          PageBell : char2;            { Sysop's Page Bell ON/OFF            }
  62.          CallAlarm: char2;            { Caller Alarm ON/OFF                 }
  63.          ModemType: char2;            { Error Correcting Modem YES/NO       }
  64.          SysopNext: Char;             { Sysop "Next On" Flag                }
  65.          BaudRate : char5;            { "CONNECT" Baud Rate of Caller       }
  66.          Name     : char25;           { Full Name of Caller   (First & Last)}
  67.  
  68.          FirstName: char15;           { First Name of Caller                }
  69.          Graphics : Char;             { Graphics Mode of Caller             }
  70.          NodeChat : Char;             { Available for Node Chat YES/NO      }
  71.          BaudOpen : char5;            { Baud Rate to Open Modem at          }
  72.  
  73.          RecordNum: Integer;           { User's Database Record Number (MKI$)}
  74.  
  75.          Password : char12;           { Password of Caller                  }
  76.          TimeLogOn: Integer;           { Time User Logged On   (MKI$ minutes)}
  77.          TimeUsed : Integer;           { Time Used Today       (MKI$ minutes)}
  78.          LogOnStr : char5;            { Time User Logged On       (HH:MM:SS)}
  79.          TimeLimit: Integer;           { Daily Time Limit      (MKI$ minutes)}
  80.          ByteLmtDL: Integer;           { Daily Download Limit  (MKI$ K-bytes)}
  81.          ConfExit : Char;              { Conference (Area) User Exited From  }
  82.          ConfFlags: char5;            { Areas User Has "Joined" Today       }
  83.          ConfScan : char5;            { Areas User Has Scanned for New Mail }
  84.          ConfTime : Integer;           { Area "Bonus" Time     (MKI$ minutes)}
  85.          TimeCred : Integer;           { Upload Time Credit    (MKI$ minutes)}
  86.          Language : char4;            { Language Version Being Used         }
  87.          TimeLeft : Integer;           { Session Time Remaining(MKI$ minutes)}
  88.          NodeNum  : Char;              { BBS Node Number That Caller is Using}
  89.          EventTime: char5;            { Scheduled EVENT Time         (HH:MM)}
  90.          EventFlag: char2;            { Is EVENT Time Active?               }
  91.          EventMove: char2;            { Delay EVENT Until User Logs Off?    }
  92.          MsgRecall: char4;            { "Memorized" Message Number    (MKS$)}
  93.          ComPortID: Char;              { Com Port Number (0, 1, 2)           }
  94.          Reserved : char2;            { Reserved for Future Use             }
  95.        End;
  96.  
  97.  
  98.    {layout of the USERS.PCB file}
  99.    pcb_user_rec = record
  100.       name:          char25;
  101.       city:          char24;
  102.       passwd:        char12;      {no spaces allowed}
  103.       busphone:      char13;
  104.       phone:         char13;
  105.       date:          char8;        {mm-dd-yy of last call}
  106.       time:          char5;        {hh:mm    of last call}
  107.       xpert:         char;         {Y or N}
  108.       protocol:      char;         {X, C, Y, N}
  109.       conferences:   char9;        {10000000}
  110.       inconference:  char;
  111.       rejoin:        char;         {Y or N}
  112.       filedate:      char6;        {yymmdd of last file directory}
  113.       level:         integer;
  114.       total_calls:   integer;
  115.       pagelen:       integer;
  116.       lastread:      array[0..9] of integer;  {for main board & each conf.}
  117.       uploads:       integer;
  118.       downloads:     integer;
  119.       lastused:      integer;            {time used on previous call}
  120.       dead:          char;               {positive delete flag}
  121.    end;
  122.  
  123. var  deffile:file of pcb_sys_rec;
  124.      outrec:PCB_SYS_REC;
  125.      timer2,timeleft2,logontime2,numout:longint;
  126.      singleout:integer;
  127.      nameout:string[31];
  128.      tl1,tl2:string[2];
  129.      tempbaud:string[4];
  130.      tempt:string[5];
  131.      u:userrec;
  132.      longtemp:longint;
  133. Begin
  134.    assign (deffile,'pcboard.sys'); {info file}
  135.    rewrite(deffile);
  136.    outrec.display:='-1';                 {display on console?  -1 or 0}
  137.    outrec.printer:=' 0';                {print log?           -1 or 0}
  138.    outrec.pagebell:=' 0';               {bother sysop?        -1 or 0}
  139.    outrec.callalarm:=' 0';              {caller alarm sound?  -1 or 0}
  140.    outrec.sysopnext:=' ';                {force sysop on next? 'N ', 'X '
  141.                                            or '  '}
  142.    outrec.modemtype:=' 0';
  143.    if (ansigraphics in urec.config)
  144.          then outrec.graphics:='N'
  145.          else outrec.graphics :=' ';     {ansi graphics mode? '-1',' 0'or'7E'}
  146.       outrec.nodechat:='N';
  147.       if local then tempbaud:=' LOCA' else
  148.          str(baudrate:5,TempBaud);         {caller's baud rate}
  149.          Tempbaud := TempBaud + #0;
  150.      Move(tempbaud[1],outrec.baudopen[1],5);
  151.       outrec.baudrate:=outrec.baudopen;
  152.       outrec.recordnum:=1;
  153.       move(urec.handle[1],outrec.firstname,15);     {caller's name}
  154.       move(urec.password[1],outrec.password,12);
  155.                          {caller's password (last 2 chars redef'd}
  156.       outrec.timelogon:=logontime;
  157.       outrec.timeused:=configset.usertim[ulvl]-urec.timetoday;{This one was scary}
  158.       str(trunc(logontime DIV 60),tl1);
  159.       str((logontime MOD 60),tl2);
  160.       tempt:=tl1+':'+tl2;                    {time the user logged on in hh:mm}
  161.       move(tempt[1],outrec.logonstr[1],5);
  162.       outrec.timelimit:=configset.usertim[ulvl];
  163.       outrec.bytelmtdl:=0;   {bytes of download limit}
  164.       FillChar(outrec.confexit,2,'0');
  165.       FillChar(outrec.confflags,5,'0');
  166.       FillChar(outrec.confscan,5,'0');
  167.       outrec.conftime:=0;
  168.       outrec.timecred:=0;
  169.       outrec.language:='    ';
  170.       move(urec.handle[1],outrec.name,25);        {caller's name}
  171.       outrec.timeleft:=urec.timetoday;
  172.       outrec.nodenum:='1';
  173.       outrec.eventtime:='00:00';
  174.       outrec.eventflag:='NO';
  175.       outrec.eventmove:='NO';
  176.       outrec.msgrecall:='0001';
  177.       outrec.comportid:='1';     {commport}
  178.       outrec.reserved:='  ';
  179.    write(deffile,outrec);
  180.    close(deffile);
  181.    end;
  182.  
  183.  
  184. Procedure dorinfo1;
  185. var        u:userrec;
  186.      deffile:text;
  187. Begin
  188.    assign (deffile,'dorinfo1.def'); {info file}
  189.    rewrite(deffile);
  190.    writeln(deffile,configset.longnam);        {BBS name}
  191.    writeln(deffile,'Martin');                   {sysop first name}
  192.    writeln(deffile,'Roachkiller');                          {sysop last name}
  193.    if local
  194.    then
  195.      writeln(deffile,'LOCAL')
  196.    else
  197.      writeln(deffile,'COM',configset.useco);                      {COMM port}
  198.    writeln(deffile,baudrate,' BAUD,N,8,1');      {baudrate^BAUD,N,n,x}
  199.    writeln(deffile,'0');                         {network type }
  200.    writeln(deffile,unam);                        {user first name}
  201.    writeln(deffile,' ');                         {user last name}
  202.    writeln(deffile,' ');                         {user city,state}
  203.    if (ansigraphics in urec.config) then         {0 no graphics }
  204.     writeln(deffile,'2') else writeln(deffile,'0'); {1-ascii  2-ansi}
  205.    writeln(deffile,ulvl);                        {user level}
  206.    writeln(deffile,timeleft);                    {time remaining}
  207.    writeln(deffile,'0');                         {EOF must have}
  208. textclose(deffile);
  209. end;
  210.  
  211.  
  212.  
  213. procedure def_user;
  214. var     deffile:text;
  215.         temptime : integer;
  216. Begin
  217.    assign (deffile,'USERINFO.TXT'); {info file}
  218.    rewrite(deffile);
  219.    writeln(deffile,unam);                        {user first name}
  220.    writeln(deffile,baudrate);
  221. if parity then
  222.    writeln(deffile,'7')
  223.           else
  224.    writeln(deffile,'8');
  225. if timeleft > 60 then temptime := 60 else temptime := timeleft;
  226.    writeln(deffile,temptime*60);                 {time remaining}
  227.    writeln(deffile,'0');                         {EOF must have}
  228. textclose(deffile);
  229. end;
  230.  
  231. Procedure Definefiles;
  232. begin
  233.   def_pcbfile;
  234.   dorinfo1;
  235.   def_user;
  236. end;
  237.  
  238.  
  239. begin
  240. end.
  241.